package com.wdg.fegin;

import com.wdg.pojo.Advert;
import com.wdg.pojo.Topic;
import com.wdg.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("provider-index")
public interface IAroundFegin {

    @PostMapping("provider_around/uploadTopic")
    boolean uploadTopic(@RequestBody Topic topic);

    @GetMapping("provider_around/getTopic/{page}")
    List<Topic> getTopic(@PathVariable("page") int page);

    @PostMapping("provider_around/login")
    User login(@RequestBody User user);

    @PostMapping("provider_around/regist")
    boolean regist(@RequestBody User user) ;

    @GetMapping("provider_around/getAllAdvert")
    List<Advert> getAllAdvert();

    @GetMapping("provider_around/getAllUser")
    List<User> getAllUser(@RequestParam("page") int page);

    //关注
    @PostMapping("provider_around/focus")
    public boolean focus(@RequestParam("uid") int uid, @RequestParam("uided") int uided);
    //取消关注
    @PostMapping("provider_around/delfocus")
    public boolean delfocus(@RequestParam("uid") int uid, @RequestParam("uided") int uided);
    //判断是否关注
    @PostMapping("provider_around/isfocus")
    public boolean isfocus(@RequestParam("uid") int uid, @RequestParam("uided") int uided);

    //收藏
    @PostMapping("provider_around/staroff")
    public boolean staroff(@RequestParam("uid") int uid, @RequestParam("cbid") String cbid);
    //取消收藏
    @PostMapping("provider_around/delstaroff")
    public boolean delstaroff(@RequestParam("uid") int uid, @RequestParam("cbid") String cbid);
    //判断是否收藏
    @PostMapping("provider_around/isstaroff")
    public boolean isstaroff(@RequestParam("uid") int uid, @RequestParam("cbid") String cbid);
}
